<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\datecontrol\DateControl;
use yii\bootstrap\Modal;
/**
 * @var yii\web\View $this
 * @var yii\widgets\ActiveForm $form
 * @var \frontend\models\SignupForm $model
 */
// $this->title = 'Signup';
// $this->params['breadcrumbs'][] = $this->title;
?>
<div class="dropdown">
    <a href="#" data-toggle="dropdown" class="dropdown-toggle">Label <b class="caret"></b></a>
    <?php
        echo \yii\bootstrap\Dropdown::widget([
            'items' => [
                ['label' => 'DropdownA', 'url' => 'www.baidu.com'],
                ['label' => 'DropdownB', 'url' => '#'],
            ],
        ]);
    ?>
</div>

<p>
    <?= Html::Button('Create Branches',['value'=>\yii\helpers\Url::to('index.php?r=branches/create'),'class' => 'btn btn-success','id'=>'activity-modal']) ?>
</p>
<!--引入模态对话框 -->
<?php
// \yii\bootstrap\Modal::begin([
//     'header' => '<h2>Branches</h2>',
//     'id'=>'modal',
//     'size'=>'modal-lg',
// ]);
//echo '<div id="modalContent"> </div>';

//\yii\bootstrap\Modal::end()
?>
<?php Modal::begin([
    'id' => 'activity-modal',
    'header' => '<h4 class="modal-title">View Image</h4>',
    'footer' => '<a href="#" class="btn btn-primary" data-dismiss="modal">Close</a>',

]); ?>

<div class="well">


</div>


<?php Modal::end(); ?>



<?php
//      Modal::begin([
//     'header' => '<h2>Hello world</h2>',
//     'toggleButton' => ['label' => 'click me'],
// ]);

//echo 'Say hello...';

//\yii\bootstrap\Modal::end();
?>
<?= \yii\bootstrap\Tabs::widget([
    'items' => [
        [
            'label' => '文章',
            'content' => $this->render('site',['model'=>$model]),
            // 'content' => 'Anim pariatur cliche...',
            'headerOptions' => ["id" => 'tab1'],
            'options' => ['id' => 'article'],
            'active' => true,
        ],
        [
            'label' => '话题',
            'content' => $this->render('test',['model'=>$model]),
            'headerOptions' => ["id" => 'tab1'],
            'options' => ['id' => 'topic'],
        ],
        [
            'label' => '链接',
            'content' => $this->render('about',['model'=>$model]),
            'headerOptions' => ["id" => 'tab3'],
            'options' => ['id' => 'url'],
        ],

    ],
]);
?>
<?php $form = ActiveForm::begin([
'id' => 'login-form',
'options' => ['class' => 'form-horizontal'],
'fieldConfig' => [
'template' => "{label}\n<div class=\"col-lg-3\">{input}</div>\n<div class=\"col-lg-8\">{error}</div>",
'labelOptions' => ['class' => 'col-lg-1 control-label'],
],
]); ?>
<style>
div.required label:after {
    content: " *";
    color: red;
}
</style>
<?= $form->field($model, 'username') ?>
<?= $form->field($model, 'username',['labelOptions' => ['label' => 'Nick name','class' => 'your own class'],'options'=>['class'=>'sss']]) ?>
<?= $form->field($model, 'username')->textInput()->hint('Please enter your nick name instead of email')->label('Nick name') ?>
<?= $form->field($model, 'password')->passwordInput() ?>
<?php ActiveForm::end(); ?>



<div class="site-signup">
    <h1><?= Html::encode($this->title) ?></h1>

    <p>Please fill out the following fields to signup:</p>

    <div class="row">
        <div class="col-lg-5">
            <?php $form = ActiveForm::begin(['id' => 'form-signup']); ?>
                <?= $form->field($model, 'username') ?>
                <?= $form->field($model, 'email') ?>
                <?= $form->field($model, 'password')->passwordInput() ?>
            <?php
            echo $form->field($model, 'createdat')->widget(DateControl::classname(), [
    'type'=>DateControl::FORMAT_DATETIME,
    'ajaxConversion'=>true,
    'options' => [
        'pluginOptions' => [
            'autoclose' => true,//选择结束后自动关闭
        ]
    ]
]);
            ?>
           <?php
           // echo $form->field($model, 'createdat')->widget(DateControl::classname(), [
            // 'autoWidget'=>false,
            //     'language' => 'zh-CN',
            //    // 'type'=>DateControl::FORMAT_TIME,
            //    'type'=>'datetime'
//               'value'=>time(),
//               'saveFormat' => 'php:U'
//               'displayFormat' => 'H/i/s',
               // 'saveFormat' => 'php:U',
               // 'convertFormat' => true,
  //         ]);?>

            <?php
//             echo DateControl::widget([
//                 'name'=>'kartik-date',
//                 'value'=>time(),
//                 'type'=>DateControl::FORMAT_TIME,
//                 'autoWidget'=>false,
//                 'displayFormat' => 'php:D, d-M-Y H:i:s A',
//     'saveFormat' => 'php:U'
// ]);
            ?>
                <div class="form-group">
                    <?= Html::submitButton('Signup', ['class' => 'btn btn-primary', 'name' => 'signup-button']) ?>
                </div>
            <?php ActiveForm::end(); ?>
        </div>
    </div>
</div>
